package com.ruoyi.project.gxgw_modules.vipUsers.service;

import com.ruoyi.common.support.Convert;
import com.ruoyi.project.gxgw_modules.vipUsers.domain.VipRegist;
import com.ruoyi.project.gxgw_modules.vipUsers.domain.VipUsers;
import com.ruoyi.project.gxgw_modules.vipUsers.domain.VipUsersVO;
import com.ruoyi.project.gxgw_modules.vipUsers.mapper.VipUsersMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 会员用户 服务层实现
 * 
 * @author ruoyi
 * @date 2019-01-18
 */
@Service
public class VipUsersServiceImpl implements IVipUsersService 
{
	@SuppressWarnings("SpringJavaInjectionPointsAutowiringInspection")
	@Autowired
	private VipUsersMapper vipUsersMapper;

	/**
     * 查询会员用户信息
     * 
     * @param userId 会员用户ID
     * @return 会员用户信息
     */
    @Override
	public VipUsers selectVipUsersById(Integer userId)
	{
	    return vipUsersMapper.selectVipUsersById(userId);
	}
	
	/**
     * 查询会员用户列表
     * 
     * @param vipUsers 会员用户信息
     * @return 会员用户集合
     */
	@Override
	public List<VipUsersVO> selectVipUsersList(VipUsersVO vipUsers)
	{
	    return vipUsersMapper.selectVipUsersList(vipUsers);
	}
	
    /**
     * 新增会员用户
     * 
     * @param vipUsers 会员用户信息
     * @return 结果
     */
	@Override
	public int insertVipUsers(VipUsers vipUsers)
	{
	    return vipUsersMapper.insertVipUsers(vipUsers);
	}
	
	/**
     * 修改会员用户
     * 
     * @param vipUsers 会员用户信息
     * @return 结果
     */
	@Override
	public int updateVipUsers(VipUsers vipUsers)
	{
	    return vipUsersMapper.updateVipUsers(vipUsers);
	}

	/**
     * 删除会员用户对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
	@Override
	public int deleteVipUsersByIds(String ids)
	{
		//return vipUsersMapper.deleteVipUsersByIds(Convert.toStrArray(ids));
		return vipUsersMapper.deleteByDel_flag(Convert.toStrArray(ids));
	}

	@Override
	public List<VipRegist> selectChartByYear(String registTime) {

		return vipUsersMapper.selectChartByYear(registTime);
	}

	@Override
	public List<VipRegist> selectChartBySeason(String registTime) {
		return vipUsersMapper.selectChartBySeason(registTime);
	}

	@Override
	public List<VipRegist> selectChartByMonth(String year, String month) {
		return vipUsersMapper.selectChartByMonth(year,month);
	}

}
